<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta http-equiv="Content-Style-Type" content="text/css">
<title></title>
<meta name="Generator" content="Cocoa HTML Writer">
<meta name="CocoaVersion" content="949.27">
<style type="text/css">
p.p1 {margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Helvetica}
p.p2 {margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Helvetica; min-height: 14.0px}
p.p3 {margin: 0.0px 0.0px 0.0px 0.0px; font: 9.0px Monaco}
p.p4 {margin: 0.0px 0.0px 0.0px 0.0px; font: 9.0px Monaco; min-height: 12.0px}
p.p5 {margin: 0.0px 0.0px 0.0px 0.0px; font: 9.0px Monaco; color: #a91616}
span.s1 {font: 18.0px Helvetica}
span.s2 {text-decoration: underline ; color: #0018ea}
span.s3 {color: #001afb}
span.s4 {color: #0000ff}
span.s5 {color: #0013bc}
span.s6 {color: #606060}
span.s7 {color: #307109}
span.Apple-tab-span {white-space:pre}
</style>
</head>
<body>
<p class="p1"><span class="s1"><b>PVSynth<span class="Apple-tab-span">	</span><span class="Apple-tab-span">	</span><span class="Apple-tab-span">	</span></b></span><b>resyntesize data with a bank of sine tones from a CSound PV analysis file</b></p>
<p class="p2"><br></p>
<p class="p1"><b>PVSynth.ar(pvbuffer, numBins, binStart, binSkip, filePointer, freqMul, freqAdd, mul, add )</b></p>
<p class="p2"><br></p>
<p class="p1">This currently only works with .pv files. .pvx and CSound 5 files will be implemented soon.</p>
<p class="p1"><b>DANGER!</b> The values stored inside the pv file for magnitudes are NOT scaled to a linear amplitude system. See PVFile (and the example below) for suggestions on how to scale these values so you don't destroy things.</p>
<p class="p2"><br></p>
<p class="p1"><b>pvbuffer</b> - The buffer containing pv data (stored with PVFile)</p>
<p class="p1"><b>numBins</b> - The number of bins to resynthesize. Default is 0.</p>
<p class="p1"><b>binStart</b> - The bin number to start on. Default value is 0.</p>
<p class="p1"><b>binSkip</b> - The number of bins to skip. Default value is 1.</p>
<p class="p1"><b>filePointer</b> - A pointer into the soundfile. 0.0 is the beginning, 1.0 is the end. Default value is 0.</p>
<p class="p1"><b>freqMul</b> - Freq value scaler. Default value is 1.0.</p>
<p class="p1"><b>freqAdd</b> - Freq value offset. Default value is 0.0.</p>
<p class="p2"><br></p>
<p class="p1"><b>See also:</b> <a href="PVFile.html"><span class="s2">PVFile</span></a><span class="s3">, <a href="PVInfo.html"><span class="s4">PVInfo</span></a></span></p>
<p class="p2"><br></p>
<p class="p3">s = <span class="s5">Server</span>.local.boot;</p>
<p class="p4"><br></p>
<p class="p5">// load a file and save it to a buffer</p>
<p class="p3">a = <span class="s5">PVFile</span>.new(<span class="s6">"sounds/cl-c4.pv"</span>, s).loadToBuffer;</p>
<p class="p4"><br></p>
<p class="p5">// what this example does</p>
<p class="p3">(</p>
<p class="p3">x = <span class="s5">SynthDef</span>(<span class="s7">\helpPVSynth</span>, {<span class="s5">arg</span> scale = 1;</p>
<p class="p3"><span class="Apple-tab-span">	</span><span class="s5">Out</span>.ar(0, <span class="s5">Pan2</span>.ar(</p>
<p class="p3"><span class="Apple-tab-span">	</span><span class="Apple-tab-span">	</span><span class="s5">PVSynth</span>.ar(a.buffer, a.nBins, 0, 1, <span class="s5">MouseX</span>.kr(0, 1),<span class="Apple-converted-space"> </span></p>
<p class="p3"><span class="Apple-tab-span">	</span><span class="Apple-tab-span">	</span><span class="Apple-tab-span">	</span>mul: a.magScale * scale),</p>
<p class="p3"><span class="Apple-tab-span">	</span><span class="Apple-tab-span">	</span>0.0));</p>
<p class="p3">}).play(s, [<span class="s7">\scale</span>, 0.2]);</p>
<p class="p3">)</p>
<p class="p4"><br></p>
<p class="p3">x.free;</p>
</body>
</html>
